<?php

define('BASE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'..');
Yii::setPathOfAlias('lib', BASE_PATH . DIRECTORY_SEPARATOR . 'libraries');
Yii::setPathOfAlias('model', BASE_PATH . DIRECTORY_SEPARATOR . 'models');
Yii::setPathOfAlias('config', BASE_PATH . DIRECTORY_SEPARATOR . 'config');
Yii::setPathOfAlias('widget', BASE_PATH . DIRECTORY_SEPARATOR . 'widget');

require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'macro.php');

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',
	'timeZone'=>'Asia/Shanghai',
	// preloading 'log' component
	//'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.components.*',
	),

    'defaultController'=>'admin/index',
    'layout' => 'main',

	// application components
	'components'=>array(
/*         'errorHandler' => array(
        	'errorAction' => 'site/error',
        ), */
		'db'=>array(
			'class'=>'CDbConnection',
			'connectionString' => 'mysql:host=localhost;dbname=mycron',
			'emulatePrepare' => true,
			'username' => 'wida',
			'password' => 'wida',
			'charset' => 'utf8',
			'tablePrefix' =>'',
		),
		'session'=>array(
				'class' => 'CHttpSession',
				'autoStart' => true,
				'cookieMode' => 'only',
				'timeout' => '1800', // session生存期30分钟
		 ),
		 'urlManager'=>array(
			 'urlFormat'=>'path',
			 'rules'=>array(
					'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			  ),
		 	'showScriptName'=> false
		  ),
	),
	'params'=>array(
        'main_domain' => CONF_MAIN_DOMAIN, //站点域名
		'static_domain' => CONF_STATIC_DOMAIN, //静态资源域名
		'skin' => 'wintertide', 
		'resource_version' => '2014032605', //静态资源版本号
	)
);